﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text.RegularExpressions;

namespace Hive.Core.Model
{
    /// <summary>
    /// Describes how the Subversion source repository has been organized.
    /// </summary>
    public class SubversionSourceRepositoryConfiguration : SourceRepositoryConfiguration
    {
        /// <summary>
        /// Creates a Subversion source repository configuration.
        /// </summary>
        public SubversionSourceRepositoryConfiguration()
        {
        }

        /// <summary>
        /// Creates a Subversion source repository configuration from a descriptor.
        /// </summary>
        /// <param name="descriptor">The descriptor.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="descriptor"/> is null.</exception>
        public SubversionSourceRepositoryConfiguration(Descriptor descriptor)
            : base(descriptor)
        {
        }

        /// <inheritdoc />
        public override ISourceRepository CreateSourceRepository()
        {
            return new SubversionSourceRepository(this);
        }

        /// <inheritdoc />
        protected override Configuration CreateInstanceOfSameType(Descriptor descriptor)
        {
            return new SubversionSourceRepositoryConfiguration(descriptor);
        }
    }
}
